package com.jetbrains.licenseService.responses;


import com.jetbrains.licenseService.Constants;
import com.jetbrains.licenseService.requests.ValidateLicenseRequest;


public class ValidateLicenseResponse extends AbstractResponse {
    private long validationPeriod;

    public ValidateLicenseResponse() {
    }

    public ValidateLicenseResponse(ResponseCode paramResponseCode, String paramString, long paramLong1, long paramLong2) {
        super(paramResponseCode, paramString, paramLong2);
        this.validationPeriod = paramLong1;
    }

    public long getValidationPeriod() {
        return this.validationPeriod;
    }

    public void setValidationPeriod(long validationPeriod) {
        this.validationPeriod = validationPeriod;
    }

    public String toString() {
        return "ValidateLicenseResponse[" + getResponseCode() + ", validationPeriod=" + this.validationPeriod + "ms, message=" + getMessage() + "]";
    }

    public static ValidateLicenseResponse error(String paramString, ValidateLicenseRequest paramValidateLicenseRequest) {
        return new ValidateLicenseResponse(ResponseCode.ERROR, paramString, Constants.DEFAULT_LICENSE_CHECK_PERIOD, paramValidateLicenseRequest.getSalt());
    }

    public static ValidateLicenseResponse serverInternalError(String paramString, ValidateLicenseRequest paramValidateLicenseRequest) {
        return new ValidateLicenseResponse(ResponseCode.SERVER_INTERNAL_ERROR, paramString, Constants.DEFAULT_LICENSE_CHECK_PERIOD, paramValidateLicenseRequest.getSalt());
    }
}
